home *** CD-ROM | disk | FTP | other *** search
- Path: onramp.arc.nasa.gov!usenet
- From: lwilliam@pioneer.arc.nasa.gov (Tom)
- Newsgroups: comp.sys.cbm
- Subject: Re: Want to read/record temp with c64
- Date: Fri, 09 Feb 1996 09:26:33 GMT
- Organization: Lone Tree Works
- Message-ID: <4ff413$jeb@onramp.arc.nasa.gov>
- References: <4e75jl$je4@news.csus.edu>
- Reply-To: lwilliam@pioneer.arc.nasa.gov
- NNTP-Posting-Host: arc-tac2-slip6.nsi.nasa.gov
- X-Newsreader: Forte Free Agent 1.0.82
-
- mrubin@gallium (Mark Rubin) wrote:
-
- >I would like to hook up a sensor to one of my spare c64s to read and
- >record outside temperatures.
-
- I dabbled in this once many years ago.
-
- I used a temperature sensor from an old electronic thermometer - really a
- thermal resistor - and attached it to the joystick port, one side to +5v, the
- other to a paddle input. A memory location would hold the resultant value,
- 0-255. Adding a couple variable resistors, one in series, one in parallel,
- would allow hardware adjustment of the sensitivity and range.
-
- Software would need tweaking to pick the useable range and increment, but is
- otherwise extremely simple: read the port, do the math, display the number,
- repeat.
-
- I did calibration with cooking oil, which proved to hold its temp longer than
- water, and an accurate thermometer, alternately warming the oil on the stove
- and cooling in an icewater bath. Remember to water-seal the sensor if you
- don't use a pre-sealed unit.
-
- Two software appraoches are possible: table lookup and algebraic calculation.
- Table lookup requires the most testing, as you would create a table of
- register values for each temperature you indicate, though takes less
- brainstorming to program. Algebraic calculation requires you create a formula
- to determine the reading and does require a few samples in a table to start,
- possibly a graph.
-
- Have fun!
-
-
-